<table width="100%" border="0" cellpadding="0" cellspacing="0" class="guide">
	<tr>
		<td>
			<span style="float: left;">后台管理中心&nbsp;&raquo;&nbsp;产品管理</span>
			<span style="float: right;">
                <!-- 
			    <a href="./?controller=account&action=accountadd">+ 添加</a>
				 -->
				<a href="javascript:history.go(-1);">&lt;- 返回</a>
			</span>
		</td>
	</tr>
</table>

<div align="center" style="margin-bottom: 8px;">
	<form action="./?controller=account&action=account" method="POST">
	<input type="hidden" name="uid" value="<?php echo $this->uid;?>" />
	产品
	<select name="pid">
		<option value="0">不限</option>
<?php
foreach ($this->product as $v)
{
	$selected = $this->pid == $v['id'] ? ' selected' : '';
	echo <<<EOF
		<option value="{$v['id']}" {$selected}>{$v['name']}</option>
EOF;
}
?>
	</select>
	&nbsp;&nbsp;
	状态
	<select name="status">
<?php
foreach ($this->account_status as $k=>$v)
{
	$selected = $this->status == $v ? ' selected' : '';
	echo <<<EOF
		<option value="{$k}" {$selected}>{$v}</option>
EOF;
}
?>
	</select>
	&nbsp;&nbsp;
	<input type="submit" value="查询">
	</form>
</div>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
	<tr class="header">
		<td colspan="10">账号列表</td>
	</tr>
	<tr class="category" align="center">
		<td width="10%">ID</td>
		<td width="10%">所属产品</td>
		<td width="10%">用户ID</td>
		<td width="10%">用户名</td>
		<td width="10%">微信号</td>
		<td width="10%">显示人数</td>
		<td width="10%">实际人数</td>
		<td width="10%">状态</td>
		<td width="10%">到期时间</td>
		<td width="10%">操作</td>
	</tr>
<?php
foreach ($this->data as $v)
{
	$pname = '';
	foreach ($this->product as $v2){
	    if($v['pid'] == $v2['id']){
	        $pname = $v2['name'];
	    }
	}
	
	$status = $this->account_status[$v['status']];
	
	//$examine = $v['status'] == 1 ? '<a href="./?controller=account&action=examine&id='.$v['id'].'&status=2">审核通过</a><br /><a href="./?controller=account&action=examine&id='.$v['id'].'&status=3">审核不通过</a><br />' : '';
	
	$endtime = $v['endtime'] == 0 ? '未激活' : date('Y-m-d',$v['endtime']+86400);
	$endtime = $endtime <= date('Y-m-d') ? '<font color="red">'.$endtime.'</font>' : $endtime;
	echo <<<EOF
	<tr>
		<td class="altbg1" align="center">{$v['id']}</td>
		<td class="altbg2" align="center">{$pname}</td>
		<td class="altbg1" align="center">{$v['uid']}</td>
		<td class="altbg2" align="center">{$v['username']}</td>
		<td class="altbg1" align="center">{$v['wechat']}</td>
		<td class="altbg2" align="center">{$v['nums_show']}</td>
		<td class="altbg1" align="center">{$v['nums_value']}</td>
		<td class="altbg2" align="center">{$status}</td>
		<td class="altbg1" align="center">{$endtime}</td>
		<td class="altbg2" align="center">
		    <a href="./?controller=account&action=accountadd&id={$v['id']}">编辑</a><br />
	        <!-- 
	        <a href="./?controller=account&action=updatepassword&id={$v['id']}">重置密码</a><br />
	         -->
	        <a href="./?controller=order&action=index&aid={$v['id']}">购买记录</a>
		    
		</td>
	</tr>
EOF;
}
?>
	<tr class="category">
		<td align="center" colspan="10">
			<?php echo $this->paging; ?>
		</td>
	</tr>
</table>
